package com.xzzz.irda.tracker.client;

import com.xzzz.irda.tracker.core.TrackerProperties;
import com.xzzz.irda.tracker.core.repository.TrackerRepository;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class TrackerClientConfiguration {

    @Bean(name = "trackerRepository")
    @ConditionalOnProperty(value = "xzzz.tracker.repository.type", havingValue = "http")
    public TrackerRepository trackerHttpRemoteServerRepository(TrackerProperties properties) {
        return new TrackerHttpRemoteServerRepository(properties);
    }

}
